<template>
  <div class="drugdetail">
    <titletop :titlename="titlename" :fixedhead="fixedhead"></titletop>
    <div class="paddingtop">
      <swipe :searchresult="searchresult" :loadimg="loadimg" :autotime="0" :iscontinue="false"></swipe>
      <div class="nearshop" @click="gonearshop">附近药店</div>
    </div>
  </div> 
</template>

<script>
import Mock from 'mockjs'
import swipe from 'components/swipe'
import titletop from 'components/title'

export default {
  name: 'drugdetail',
  props : [],
  data () {
    return {
      titlename:'阿莫西林',
      fixedhead:'fixedhead',
      searchresult:[]
    }
  },
  components: {
    titletop,
    swipe
  },
  methods : {
      getswipelist(){
          let data = Mock.mock({
              // 属性 list 的值是一个数组，其中含有 5 个元素
              'list|5': [{
                  // 属性 id 是一个自增数，起始值为 1，每次增 1
                  'id|+1': 1,
                  'imgUrl|1' : ['../../static/img/drug1.png','../../static/img/drug2.png','../../static/img/drug3.png','../../static/img/rectangle2.png']
              }]
          });
          this.searchresult = data.list;
      },
      gonearshop(){
        this.$router.push({ name: 'nearshop'});
      }
  },
  mounted(){
      console.log(this.$route.params)
      this.getswipelist();
  }
}

</script>

<style lang="scss" scoped>
  .nearshop{
    position: fixed;
    bottom:0;
    width:100%;
    height:40px;
    background-color:#eeeeee;
  }
</style>
